cmake_minimum_required(VERSION 2.8.3)
project(ok_hknetcam)

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
)

add_service_files(
  FILES
  CapPicture.srv
  PtzPreset.srv
)

generate_messages(
  DEPENDENCIES

)
catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp message_runtime
  DEPENDS system_lib
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)
link_directories(
  libs/HCNetSDKCom
  libs
)
file(GLOB_RECURSE USER_LIBS_PATH ./libs/*.so)

list(APPEND GAME_SOURCE_MINE ${USER_LIBS_PATH})

 add_executable(${PROJECT_NAME} src/ok_hknetcam.cpp)

add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

 target_link_libraries(${PROJECT_NAME}
   ${catkin_LIBRARIES}
   ${GAME_SOURCE_MINE}

)

install(TARGETS ${PROJECT_NAME}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h"
  PATTERN ".svn" EXCLUDE
)
foreach(dir launch libs srv)
	install(DIRECTORY ${dir}/
		DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach(dir)
install(FILES
  README.md
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)


